import request from '@/utils/request'

export function getTable(params) {
  return request({
    url: 'api/inventory/queryInventory',
    method: 'get',
    params
  })
}

export function del(ids) {
  return request({
    url: 'api/inboundTask/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/inboundTask',
    method: 'put',
    data
  })
}

// 冻结
export function frozenAPI(data) {
  return request({
    url: 'api/inventory/freezeDefectiveInventory',
    method: 'post',
    data
  })
}

// 解冻
export function unFrozenAPI(data) {
  return request({
    url: 'api/inventory/unfreezeInventory',
    method: 'post',
    data
  })
}

export function downloadFileAPI(params) {
  return request({
    url: 'api/inventory/dullInventoryDownload',
    method: 'get',
    responseType: 'blob',
    params
  })
}

export default { getTable, edit, del }
